import { createStore } from 'vuex'

export default createStore({
  state: {
    list:[
      {
        title:'烤冷面',
        text:false
    },
    {
        title:'烤鸡腿',
        text:false
    },
    {
        title:'虾尾',
        text:false
    },
    {
        title:'烤鱿鱼',
        text:true
    },
    ]
  },
  getters: {
  },
  mutations: {
    //添加
    addtodo(state,obj){
      state.list.push(obj)
    },
    //删除
    del(state,obj){
      state.list.splice(obj,1)
    },
    //删除已完成
    dels(state,obj){
      state.list=obj
    }
  },
  actions: {
  },
  modules: {
  }
})
